package cn.jsp;

import com.zaxxer.hikari.HikariDataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
@ComponentScan("cn.jsp")
public class JavaConfig {
  @Bean
  public DataSource dataSource(){
    HikariDataSource dataSource=new HikariDataSource();
    dataSource.setDriverClassName("org.hsqldb.jdbc.JDBCDriver");
    dataSource.setJdbcUrl("jdbc:hsqldb:hsql://localhost/");
    dataSource.setUsername("sa");
    dataSource.setPassword("");
    return dataSource;
  }
}
